﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Sys.Common
{
    public static class Instantiation<T> where T : new()
    {
        private static readonly object Sync = new object();

        private static T example;

        public static T Example
        {
            get
            {
                if (example == null)
                {
                    lock (Sync)
                    {
                        example = new T();
                    }
                }

                return example;
            }
        }
    }
}
